home *** CD-ROM | disk | FTP | other *** search
- Path: sun001.spd.dsccc.com!spd!jmccarty
- From: jmccarty@spd.dsccc.com (Mike McCarty)
- Newsgroups: comp.lang.c
- Subject: Re: Please please help a newbie!!
- Date: 15 Feb 1996 19:30:04 GMT
- Organization: DSC Communications Corporation, Plano, Texas USA
- Message-ID: <4g01js$h6q@sun001.spd.dsccc.com>
- References: <4fth5k$43v@pacifica.access.ch>
- NNTP-Posting-Host: aplo139.spd.dsccc.com
-
- In article <4fth5k$43v@pacifica.access.ch>,
- Thomas Beck <tombeck@usemail.com> wrote:
- )Hi there!
- )
- )It's quite embarrassing to ask those two questions, because they seem
- )absolutely stupid (they probably are). Yesterday I started to learn C/C++. I
- )bought a 700 pages book with a cd included that has two compilers on it). I
- )fully understand the chapter about the types, but the things I program just
- )can't be compiled. I extracted the following two problems:
- )
- )----------- example 1: -------------
- )int i;
- )int & a=i;
- ^ If you are trying to declare a pointer to
- an integer, and set it to point to i, then you need this line:
-
- int *a = &i;
-
-
- )main() {
- )}
-
- [error results cut]
-
- )The second thing that doesn't work is this:
- )
- )----------- example 2: -------------
- )struct abc {
- ) int i;
- ) char a;
- ) void f1() {
- ^ If you are trying to declare a pointer
- to a function returning void, then you need
- void *f1();
- no "{}" are needed.
- ) };
- )};
- )
- )main() {
- )}
-
- [errors cut]
-
- )Before you think I'm absolutely stupid... I used to be very good at Pascal
-
- Not stupid, just ignorance. And ignorance, like epoxy, can be cured
- (there is no cure for stupidity).
-
- Mike
- ----
- char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
-
- I don't speak for DSC. <- They make me say that.
-